package dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;

import dao.MerchantDao;
import vo.Merchant;

@Repository("md")
public class MerchantDaoImpl implements MerchantDao {
	@PersistenceContext(name = "un")
	private EntityManager em;

	@Override
	public int addMerchant(Merchant merchant) {
		em.persist(merchant);
		return merchant.getmId();
	}

	@Override
	public int updateMerchant(Merchant merchant) {
		Merchant merchant2=em.find(Merchant.class, merchant.getmId());
		
		return 0;
	}

	@Override
	public Merchant findMerchantByTel(String tel) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Merchant findMerchantById(Integer mId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateMerchantByAdmin(Integer mId, Integer oStatus) {
		// TODO Auto-generated method stub
		return 0;
	}

}
